// 应用常量定义

// 平台配置常量
export const PLATFORM_CONFIGS = {
  douyin: {
    name: '抖音',
    packageName: 'com.ss.android.ugc.aweme',
    startXRatio: 0.5,
    startYRatio: 0.8,
    endXRatio: 0.5,
    endYRatio: 0.2,
    swipeType: 'vertical',
    adAvoidRegions: [
      { x: 0, y: 0, width: 1, height: 0.15 }, // 顶部广告区域
      { x: 0, y: 0.85, width: 1, height: 0.15 } // 底部评论区
    ]
  },
  kuaishou: {
    name: '快手',
    packageName: 'com.smile.gifmaker',
    startXRatio: 0.5,
    startYRatio: 0.8,
    endXRatio: 0.5,
    endYRatio: 0.2,
    swipeType: 'vertical',
    adAvoidRegions: []
  },
  bilibili: {
    name: '哔哩哔哩',
    packageName: 'tv.danmaku.bili',
    startXRatio: 0.8,
    startYRatio: 0.5,
    endXRatio: 0.2,
    endYRatio: 0.5,
    swipeType: 'horizontal',
    adAvoidRegions: []
  },
  local: {
    name: '本地视频',
    packageName: null,
    startXRatio: 0.5,
    startYRatio: 0.8,
    endXRatio: 0.5,
    endYRatio: 0.2,
    swipeType: 'vertical',
    adAvoidRegions: []
  }
};

// 滑动速度配置
export const SCROLL_SPEEDS = {
  fast: { duration: 300, name: '快' },
  medium: { duration: 500, name: '中' },
  slow: { duration: 800, name: '慢' }
};

// 默认设置
export const DEFAULT_SETTINGS = {
  interval: 10000, // 默认10秒
  speed: 'medium',
  direction: 'vertical',
  platform: 'douyin',
  autoStart: false,
  showFloatingButton: true
};

// 存储键名
export const STORAGE_KEYS = {
  SETTINGS: '@auto_scroll_settings',
  STATISTICS: '@auto_scroll_statistics',
  USAGE_HISTORY: '@auto_scroll_usage_history',
  BACKUP: '@auto_scroll_backup'
};

// 权限配置
export const PERMISSION_CONFIG = {
  android: {
    overlay: 'android.permission.SYSTEM_ALERT_WINDOW',
    storage: 'android.permission.READ_EXTERNAL_STORAGE',
    media: 'android.permission.READ_MEDIA_IMAGES'
  },
  ios: {
    photo: 'ios.permission.PHOTO_LIBRARY',
    background: 'ios.permission.BACKGROUND_APP_REFRESH'
  }
};

// 悬浮窗配置
export const FLOATING_BUTTON_CONFIG = {
  size: 60,
  alpha: 0.8,
  backgroundColor: '#3498db',
  borderRadius: 30,
  elevation: 8
};

// 性能配置
export const PERFORMANCE_CONFIG = {
  maxMemoryUsage: 50 * 1024 * 1024, // 50MB
  maxCpuUsage: 10, // 10%
  maxResponseDelay: 100, // 100ms
  maxContinuousRuntime: 24 * 60 * 60 * 1000 // 24小时
};

// UI配置
export const UI_CONFIG = {
  primaryColor: '#3498db',
  secondaryColor: '#2ecc71',
  backgroundColor: '#f5f5f5',
  textColor: '#333333',
  borderRadius: 8,
  padding: 16
};